let a: null = null

let age: number = 18

let myName: string = 'zs'
// 创建数组
let numbers: number[] = [1, 2, 3]
let numbers1: Array<number> = [2, 3, 57, 100]
let b: boolean[] = [true, false]
// 联合类型
let arr: (number | string)[] = [1, '2']
// 类型别名，可以省点事
type myType = (number | string)[]
let arr1: myType = [1, 3, '5']
// 函数参数及返回值也可以指定类型
function add(num1: number, num2: number): number {
  return num1 + num2
}
const addd: (num1: number, num2: number) => number = (num1, num2) => {
  return num1 + num2
}

// console.log(add(3,5));
